<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../../include/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>期号列表</title>
    <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
            border: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

    </style>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <link href="/css/demo.css" rel="stylesheet" type="text/css"/>
    <script src="/scripts/boot.js" type="text/javascript"></script>
</head>
<body>

<div style="padding-bottom:5px;padding-left: 0px;">

    <div id="form1">
        <table border="0" cellpadding="1" cellspacing="2">
            <tr>
            <td>状态：</td>
					<td>
					<input name="status" class="mini-combobox" style="width:150px;" onvaluechanged="search()"
                                   textField="text" valueField="code" emptyText="请选择..."
                                   url="/gamblingPeriod/getPeriodStatus.action" showNullItem="true"
                                   nullItemText="请选择..."/>
                                   </td>
                <td>
                   	 期号：
                </td>
                <td>
                    <input name="period" id="period" emptyText="请输入期号" class="mini-textbox"/>
                </td>
                <td>
                    	开奖区间：
                </td>
                <td>
                    <input emptyText="请输入开始时间" allowInput="false" style="width: 200px;" id="startTime" name="startDate" class="mini-datepicker" format="yyyy-MM-dd HH:mm:ss" timeFormat="HH:mm:ss" showTime="true" showOkButton="true" showClearButton="false" />
                </td>
				<td>
					<span class="separator"></span>
				</td>
				<td>
					<input emptyText="请输入结束时间" allowInput="false"  style="width: 200px;" id="endTime" name="endDate" class="mini-datepicker" format="yyyy-MM-dd HH:mm:ss" timeFormat="HH:mm:ss" showTime="true" showOkButton="true" showClearButton="false" />
                </td>
                <td colspan="2" align="center"><a class="mini-button" iconCls="icon-search" onClick="search()">搜索</a>&nbsp;<a
                        class="mini-button" iconCls="icon-reload" onClick="clean()">重置</a>
                </td>
            </tr>
        </table>
    </div>
</div>
<div id="datagrid1" class="mini-datagrid" style="width:99%;height:85%;"
     url="/gamblingPeriod/queryGamblingPeriod.action" idField="id" allowResize="true" allowCellWrap="true"
     >
    <div property="columns">
        <div type="indexcolumn"></div>
        <div field="id" width="80" headerAlign="center" align="center">ID</div>
        <div field="period" width="100" headerAlign="center" align="center">期号</div>
        <div field="productNameEn" width="100" headerAlign="center" align="center">商品名称</div>
        <div field="startAndEndTime" width="200" headerAlign="center" align="center">开售时间/开奖时间</div>
        <div field="sumAndRemainCount" width="140" headerAlign="center" align="center">总份额/剩余份额</div>
        <div field="periodStatusEnum.text" width="80" headerAlign="center" align="center">状态</div>
        <div field="userName" width="80" headerAlign="center" align="center">中奖用户</div>
        <div field="luckyNumber" width="80" headerAlign="center" align="center">中奖号码</div>
        <div field="countryCodeEnum.text" width="80" headerAlign="center" align="center">活动地区</div>
		<div name="action" width="100" headerAlign="center" align="center"
				renderer="onActionRenderer" cellStyle="padding:0;">操作</div>
    </div>
</div>

<script type="text/javascript">

    mini.parse();
    var grid = mini.get("datagrid1");
    var form = new mini.Form("#form1"); //获取表单对象
    grid.load();
    //查询
    function search() {
        var data = form.getData();      //获取表单多个控件的数据
        var json = mini.encode(data);   //序列化成JSON
        grid.load({json: json});
    }

    function clean() {
        form.reset();
    }
    function onActionRenderer(e) {
		var record = e.record;
		var uid = record.id;
		var rowIndex = e.rowIndex;
		var s = ' <a class="Edit_Button" href="javascript:detail(\''
				+ uid + '\')">Detail</a>';
		return s;
	}
    function detail(){
    	var row = grid.getSelected();
		mini.open({
            url: "/gamblingRecord/gamblingPeriodCustomer.action",
            title: "期数客户列表",
            width: 1234,
            height: 555,
            onload: function () {
                var iframe = this.getIFrameEl();
                var data = {periodId: row.id};
                iframe.contentWindow.SetData(data);
            },
            ondestroy: function (action) {
                grid.reload();
            }
        });
	}
</script>
</body>
</html>
